We were only handling the error in one place anyway.
* All parts of the dialog are optional.
*
* About dialogs often contain links and email addresses. GtkAboutDialog
- * displays these as clickable links. By default, it calls gtk_show_uri_on_window()
+ * displays these as clickable links. By default, it calls gtk_show_uri()
* when a user clicks one. The behaviour can be overridden with the
* #GtkAboutDialog::activate-link signal.
*
*
* The signal which gets emitted to activate a URI.
* Applications may connect to it to override the default behaviour,
- * which is to call gtk_show_uri_on_window().
+ * which is to call gtk_show_uri().
*
* Returns: %TRUE if the link has been activated
*/
gtk_about_dialog_activate_link (GtkAboutDialog *about,
const gchar *uri)
{
- GError *error = NULL;
-
- if (!gtk_show_uri_on_window (GTK_WINDOW (about), uri, GDK_CURRENT_TIME, &error))
- {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (about),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s", _("Could not show link"));
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- "%s", error->message);
- g_error_free (error);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
-
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_window_present (GTK_WINDOW (dialog));
- G_GNUC_END_IGNORE_DEPRECATIONS
- }
-
+ gtk_show_uri (GTK_WINDOW (about), uri, GDK_CURRENT_TIME);
return TRUE;
}
gchar *uri;
uri = g_file_get_uri (file);
- gtk_show_uri_on_window (GTK_WINDOW (toplevel), uri, GDK_CURRENT_TIME, NULL);
+ gtk_show_uri (GTK_WINDOW (toplevel), uri, GDK_CURRENT_TIME);
g_free (uri);
}
*
* The signal which gets emitted to activate a URI.
* Applications may connect to it to override the default behaviour,
- * which is to call gtk_show_uri_on_window().
+ * which is to call gtk_show_uri().
*
* Returns: %TRUE if the link has been activated
*/
{
GtkWidget *widget = GTK_WIDGET (label);
GtkWidget *toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
- GError *error = NULL;
if (!GTK_IS_WINDOW (toplevel))
return FALSE;
- if (!gtk_show_uri_on_window (GTK_WINDOW (toplevel), uri, GDK_CURRENT_TIME, &error))
- {
- g_warning ("Unable to show '%s': %s", uri, error->message);
- g_error_free (error);
- }
+ gtk_show_uri (GTK_WINDOW (toplevel), uri, GDK_CURRENT_TIME);
return TRUE;
}
* The URI bound to a GtkLinkButton can be set specifically using
* gtk_link_button_set_uri(), and retrieved using gtk_link_button_get_uri().
*
- * By default, GtkLinkButton calls gtk_show_uri_on_window() when the button is
+ * By default, GtkLinkButton calls gtk_show_uri() when the button is
* clicked. This behaviour can be overridden by connecting to the
* #GtkLinkButton::activate-link signal and returning %TRUE from the
* signal handler.
* The ::activate-link signal is emitted each time the #GtkLinkButton
* has been clicked.
*
- * The default handler will call gtk_show_uri_on_window() with the URI stored inside
+ * The default handler will call gtk_show_uri() with the URI stored inside
* the #GtkLinkButton:uri property.
*
* To override the default behavior, you can connect to the ::activate-link
{
GtkLinkButtonPrivate *priv = gtk_link_button_get_instance_private (link_button);
GtkWidget *toplevel;
- GError *error;
toplevel = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (link_button)));
- error = NULL;
- gtk_show_uri_on_window (GTK_WINDOW (toplevel), priv->uri, GDK_CURRENT_TIME, &error);
- if (error)
- {
- g_warning ("Unable to show '%s': %s",
- priv->uri,
- error->message);
- g_error_free (error);
-
- return FALSE;
- }
-
+ gtk_show_uri (GTK_WINDOW (toplevel), priv->uri, GDK_CURRENT_TIME);
gtk_link_button_set_visited (link_button, TRUE);
return TRUE;
char *uri;
uri = g_filename_to_uri (filename, NULL, NULL);
- gtk_show_uri_on_window (parent, uri, GDK_CURRENT_TIME, NULL);
+ gtk_show_uri (parent, uri, GDK_CURRENT_TIME);
g_free (uri);
}
g_error_free (error);
error = NULL;
uri = g_filename_to_uri (filename, NULL, NULL);
- gtk_show_uri_on_window (parent, uri, GDK_CURRENT_TIME, &error);
+ gtk_show_uri (parent, uri, GDK_CURRENT_TIME);
g_free (uri);
}